function [output] = BandPassFilter(data, flp, fhi, delt)

% bandpass a time series with a 2nd order butterworth filter
%
% c = input time series
% flp = lowpass corner frequency of filter
% fhi = hipass corner frequency
% delt = sampling interval of data
%
n = 2;      % 2nd order butterworth filter
fnq = 1/(2*delt);  % Nyquist frequency
Wn = [flp/fnq fhi/fnq];    % butterworth bandpass non-dimensional frequency
%Wn
[b,a] = butter(n, Wn); % construct the filter
output = filtfilt(b, a, data); % zero phase filter the data
return;